package com.hfb.mashibing.alip8.designpattern._03_04factory;

public class Main {

    public static void main(String[] args) {

        Moveable m = new Car();
        m.go();

        m = new Plane();
        m.go();

        m = new Broom();
        m.go();
    }
}

interface Moveable {
    void go();
}
class Car implements Moveable {

    @Override
    public void go() {
        System.out.println("小汽车🚗 go go go ....");
    }
}
class Plane implements Moveable {

    @Override
    public void go() {
        System.out.println("飞机✈️ flying ....");
    }
}
class Broom implements Moveable {

    @Override
    public void go() {
        System.out.println("扫把 flying ....");
    }
}
